package com.example.service;


import cn.hutool.core.bean.BeanUtil;
import com.example.bean.*;
import com.example.bean.dto.AuditDTO;
import com.example.bean.dto.BlockchainCompanyInfoDTO;
import com.example.bean.query.BlockchainApplicationQuery;
import com.example.bean.query.BlockchainCompanyListVO;
import com.example.bean.query.BlockchainExportQuery;
import com.example.bean.vo.*;
import com.example.common.InvokeResult;
import com.example.dao.*;
import com.example.utils.EmailUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.*;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;


@Service
public class BlockchainApplicationService {

	@Autowired
	private BlockchainCompanyInfoRepository repository;
	@Autowired
	private BlockchainCompanyProductRepository productrepository;
	@Autowired
	private ExpertInfoRepository expertinforepository;
	@Autowired
	private UseCaseRepository usercaserepository;
	@Autowired
	private FounderProfileRepository founderprofilerepository;
	@Autowired
	private InvestmentFinancingRepository investrepository;
	public final static Map<String,String> firsttype = new HashMap() {{   
		put("1","硬件组件");
		put("2","软件组件");
		put("3","平台");
		put("4","服务");
		put("5","应用");
		put("6","产业服务");
		put("7","基础设施");
		put("8","其他");

	}};
	public final static Map<String,String> sectype = new HashMap() {{   
		put("11","可信存储和计算");
		put("12","矿机芯片");
		put("21","共识算法");
		put("22","智能合约");
		put("23","密钥管理");
		put("24","跨链/并发");
		put("25","安全");
		put("26","交易所");
		put("27","钱包");
		put("31","公有链");
		put("32","联盟链");
		put("33","闭源联盟链");
		put("41","平台即服务");
		put("42","区块链云服务BaaS");
		put("51","金融服务");
		put("52","存证/溯源");
		put("53","数字身份");
		put("54","供应链");
		put("55","民生");
		put("56","政务");
		put("57","支付");
		put("61","行业组织");
		put("62","市场服务");
		put("63","产品服务");
		put("71","基础设施");
		put("81","其他");

	}};


	@Transactional(rollbackFor = Exception.class)
	public void delete(Long id) {
		repository.deleteById(id);
	}
	@Transactional(rollbackFor = Exception.class)
	public BlockchainCompanyInfo getcreditid(String ids) {
		return repository.findByGeneralCreditCode(ids);
	}

	public BlockchainCompanyInfoVO getblockinfos(BlockchainCompanyInfo info) {
		BlockchainCompanyInfoVO invos=BeanMapper.map(info,BlockchainCompanyInfoVO.class);
		invos.setId(info.getId());

		List<BlockchainCompanyProduct> produces=productrepository.findByBlockchaincompanyid(info.getId());

		if(produces!=null) {
			List<ProductInfoVO> productInfos=new ArrayList<ProductInfoVO>();
			for(BlockchainCompanyProduct produce:produces) {
				ProductInfoVO product=new ProductInfoVO();
				BeanUtil.copyProperties(produce, product);
				if(produce.isOpensource())
					product.setOpensource("1");
				else product.setOpensource("0");
				List<UseCase> usecases=usercaserepository.findByProductId(produce.getId());
				if(usecases!=null) {
					List<UseCaseVO> usercases=new ArrayList<UseCaseVO>();
					for(UseCase usercase:usecases) {
						UseCaseVO uscase=new UseCaseVO();
						BeanUtil.copyProperties(usercase, uscase);
						usercases.add(uscase);
					}
					product.setUseCase(usercases);
				}


				JSONObject obj = JSONObject.parseObject(produce.getProductscale());
				ProductScaleVO scales = JSONObject.toJavaObject(obj,ProductScaleVO.class);//将建json对象转换为Person对象
				product.setProductscale(scales);
				productInfos.add(product);
			}
			invos.setProductInfos(productInfos);
		}
		List<ExpertInfo> experts=expertinforepository.findByBlockchaincompanyid(info.getId());
		if(experts!=null) {
			List<ExpertVO> productInfos=new ArrayList<ExpertVO>();
			for(ExpertInfo produce:experts) {
				ExpertVO product=new ExpertVO();
				BeanUtil.copyProperties(produce, product);
				List<PatentVO> patent=JSONObject.parseArray(produce.getPatent(), PatentVO.class);
				product.setPatent(patent);
				List<SoftwareVO> software=JSONObject.parseArray(produce.getSoftware(), SoftwareVO.class);
				product.setSoftware(software);

				List<StandfordVO> standford=JSONObject.parseArray(produce.getStandford(), StandfordVO.class);
				product.setStandford(standford);
				List<ArticleVO> article=JSONObject.parseArray(produce.getArticle(), ArticleVO.class);
				product.setArticle(article);

				productInfos.add(product);
			}
			invos.setExperts(productInfos);
		}
		List<FounderProfile> founderprofile=founderprofilerepository.findByBlockchaincompanyid(info.getId());
		if(founderprofile!=null) {
			List<FounderProfileVO> create=new ArrayList<FounderProfileVO>();
			List<FounderProfileVO> techleader=new ArrayList<FounderProfileVO>();
			for(FounderProfile produce:founderprofile) {
				FounderProfileVO product=new FounderProfileVO();
				BeanUtil.copyProperties(produce, product);


				if(product.getType()==0)create.add(product);
				else techleader.add(product);
			}
			invos.setTechnologyleader(techleader);
			invos.setCreateleader(create);

		}
		List<InvestmentFinancing> investment=investrepository.findByBlockchaincompanyid(info.getId());
		if(investment!=null) {
			List<InvestmentFinacingVO> productInfos=new ArrayList<InvestmentFinacingVO>();
			for(InvestmentFinancing produce:investment) {
				InvestmentFinacingVO product=new InvestmentFinacingVO();
				BeanUtil.copyProperties(produce, product);
				productInfos.add(product);
			}
			invos.setInvestmetnfinacing(productInfos);
		}

		if(info.getIsHighTech()!=null) {
			if(info.getIsHighTech())
				invos.setIsHighTech("1");
			else invos.setIsHighTech("0");
		}
		return invos;
	}
	public void deleteinfos(long id, int type) {
		/*
		 * 删除对象类别 1产品 2 专家 3 投资 4创始人
		 */
		if(type==1) {

			List<BlockchainCompanyProduct> produc=productrepository.findByBlockchaincompanyid(id);
			for(BlockchainCompanyProduct pro:produc) {
				List<UseCase> usecases=usercaserepository.findByProductId(pro.getId());
				usercaserepository.deleteAll(usecases);
			}
			productrepository.deleteAll(produc);
		}
		else if(type==2) {
			List<ExpertInfo> experts=expertinforepository.findByBlockchaincompanyid(id);
			expertinforepository.deleteAll(experts);
		}
		else if(type==3) {
			List<InvestmentFinancing> investment=investrepository.findByBlockchaincompanyid(id);
			investrepository.deleteAll(investment);
		}
		else if(type==4) {
			List<FounderProfile> founderprofile=founderprofilerepository.findByBlockchaincompanyid(id);
			founderprofilerepository.deleteAll(founderprofile);
		}
	}
	public void deleteproduct(Long productid){
		productrepository.deleteById(productid);
	}
	public List<BlockchainCompanyInfo> getRecordByIds(String ids2) {
		String[] ids1=ids2.split(",");
		List<Long> ids=new ArrayList<Long>();
		for(String  id: ids1) {
			long b=Long.valueOf(id);
			ids.add(b);
		} 

		List<BlockchainCompanyInfo> infos=repository.findAllById(ids);
		return infos;

	}




	private String getshort(String string,int count) {

		if(string.length()>count) {
			StringBuilder builder=new StringBuilder();
			int begin=0;
			int end=count;
			while(begin<string.length()) {
				builder.append(string.substring(begin,end)+"<br></br>");
				begin=end;
				end=(end+count)>string.length()?string.length():end+count; 
			}
			return builder.toString();
		}
		return string;
	}

	
	public InvokeResult audit(AuditDTO dto){

		Optional<BlockchainCompanyInfo> infos=repository.findById(dto.getId());
		if(infos!=null&&infos.get()!=null) {
			BlockchainCompanyInfo info=infos.get();
			info.setAuditComment(dto.getAuditComment());
			info.setAuditStatus(dto.getAuditStatus());


			LocalDate time = LocalDate.now();
			info.setAuditDate(time);
			repository.save(info);
			if(dto.getAuditStatus()==2) {
				EmailUtil util=new EmailUtil();

				util.getAccess(dto.getAuditComment(),info.getContactPersonEmail());
			}
			return InvokeResult.success();
		}
		else {
			return InvokeResult.success("1","数据库无对应数据");

		}

	}
	public List<BlockchainCompanyInfo> findAll(BlockchainExportQuery queryDTO) {
		//Sort sort =new Sort("submitDate");
		Direction tempDirection = Direction.DESC;
		String tempSortBy = "submitDate";
		//		Sort sort = new Sort(Direction.ASC, "submitDate");
		//		if (queryDTO.getSort() != null) {
		//			switch (queryDTO.getSort()) {
		//				case "1":
		//					tempDirection = Direction.ASC;
		//					tempSortBy = "submitDate";
		//					sort = new Sort(Direction.ASC, "submitDate");
		//					break;
		//				case "2":
		//					tempDirection = Direction.DESC;
		//					tempSortBy = "submitDate";
		//					sort = new Sort(Direction.DESC, "submitDate");
		//					break;
		//				case "3":
		//					tempDirection = Direction.ASC;
		//					tempSortBy = "name";
		//					sort = new Sort(Direction.ASC, "name");
		//					break;
		//				case "4":
		//					tempDirection = Direction.DESC;
		//					tempSortBy = "name";
		//					sort = new Sort(Direction.DESC, "name");
		//					break;
		//				case "5":
		//					tempDirection = Direction.ASC;
		//					tempSortBy = "park";
		//					sort = new Sort(Direction.ASC, "park");
		//					break;
		//				case "6":
		//					tempDirection = Direction.DESC;
		//					tempSortBy = "park";
		//					sort = new Sort(Direction.DESC, "park");
		//					break;
		//				case "7":
		//					tempDirection = Direction.ASC;
		//					tempSortBy = "auditDate";
		//					sort = new Sort(Direction.ASC, "auditDate");
		//
		//					break;
		//				case "8":
		//					tempDirection = Direction.DESC;
		//					tempSortBy = "auditDate";
		//					sort = new Sort(Direction.DESC, "auditDate");
		//					break;
		//				case "9":
		//					tempDirection = Direction.ASC;
		//					tempSortBy = "auditStatus";
		//					sort = new Sort(Direction.ASC, "auditStatus");
		//					break;
		//				case "10":
		//					tempDirection = Direction.DESC;
		//					tempSortBy = "auditStatus";
		//					sort = new Sort(Direction.DESC, "auditStatus");
		//					break;
		//			}
		//		} else {
		//			tempDirection = Direction.ASC;
		//			tempSortBy = "submitDate";
		//			sort = new Sort(Direction.ASC, "submitDate");
		//		}
		final Direction direction = tempDirection;
		final String sortBy = tempSortBy;
		Specification specification = new Specification<BlockchainCompanyInfo>(){
			@Override
			public Predicate toPredicate(Root<BlockchainCompanyInfo> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {
				List<Predicate> predicates = new ArrayList<>();


				if(queryDTO.getName()!=null&&queryDTO.getName().length()>0)
					predicates.add(criteriaBuilder.like(root.get("name"), "%" + queryDTO.getName() + "%"));
				if(queryDTO.getSubmitDate()!=null)predicates.add(criteriaBuilder.equal(root.get("submitDate"), queryDTO.getSubmitDate()));
				if(queryDTO.getAuditDate()!=null)predicates.add(criteriaBuilder.equal(root.get("auditDate"), queryDTO.getAuditDate()));
				if(queryDTO.getPark()!=null&&queryDTO.getPark().length()>0)
					predicates.add(criteriaBuilder.like(root.get("park"), "%" + queryDTO.getPark() + "%"));

				if(queryDTO.getAuditStatus()!=3)predicates.add(criteriaBuilder.equal(root.get("auditStatus"), queryDTO.getAuditStatus()));
				predicates.add(criteriaBuilder.equal(root.get("isDelete"), false));
				predicates.add(criteriaBuilder.equal(root.get("tianxiestatus"), 1));
				if(direction.equals(Direction.ASC)){
					query.orderBy(criteriaBuilder.asc(root.get(sortBy)));
				}else{
					query.orderBy(criteriaBuilder.desc(root.get(sortBy)));
				}
				return criteriaBuilder.and(predicates.toArray(new Predicate[predicates.size()]));
			}
		};
		List<BlockchainCompanyInfo> pagedList = repository.findAll(specification);
		return pagedList;
	}

	@Transactional(rollbackFor = Exception.class)

	public void savenewdata(BlockchainCompanyInfoVO dto,Long id) {
		/*
		 * 存储产品信息
		 */
		List<BlockchainCompanyProduct> produces=new ArrayList<BlockchainCompanyProduct>();
		if(dto.getProductInfos()!=null)
			for(ProductInfoVO p1vo:dto.getProductInfos()) {
				BlockchainCompanyProduct p1=new BlockchainCompanyProduct();
				BeanUtils.copyProperties(p1vo, p1);
				p1.setBlockchaincompanyid(id);
				if(p1vo.getOpensource().equals("1")) 
					p1.setOpensource(true);
				else p1.setOpensource(false);
				p1.setTianbaostatus(1);
				String prodectscale=JSON.toJSON(p1vo.getProductscale()).toString();

				p1.setProductscale(prodectscale);
				productrepository.save(p1);
				List<UseCase> usecases=BeanMapper.mapList(p1vo.getUseCase(), UseCaseVO.class, UseCase.class);
				for(UseCase case1:usecases) {

					case1.setProductId(p1.getId());
					usercaserepository.save(case1);
				}


			}
		/*
		 * 存储专家信息
		 */
		if(dto.getExperts()!=null)
			for(ExpertVO p1vo:dto.getExperts()) {
				ExpertInfo p1=new ExpertInfo();
				BeanUtils.copyProperties(p1vo, p1);
				p1.setBlockchaincompanyid(id);
				if(p1vo.getPatent()!=null) {
					String patent=JSON.toJSON(p1vo.getPatent()).toString();
					p1.setPatent(patent);
				}
				if(p1vo.getArticle()!=null) {
					String article=JSON.toJSON(p1vo.getArticle()).toString();
					p1.setArticle(article);
				}
				if(p1vo.getSoftware()!=null) {
					String software=JSON.toJSON(p1vo.getSoftware()).toString();
					p1.setSoftware(software);
				}
				if(p1vo.getStandford()!=null) {
					String standford=JSON.toJSON(p1vo.getStandford()).toString();
					p1.setStandford(standford);
				}
				expertinforepository.save(p1);
			}
		/*
		 * 存储创始人信息
		 */
		if(dto.getCreateleader()!=null)
			for(FounderProfileVO produce:dto.getCreateleader()) {
				FounderProfile product=new FounderProfile();
				BeanUtil.copyProperties(produce, product);
				product.setBlockchaincompanyid(id);
				founderprofilerepository.save(product);
			}
		/*
		 * 存储技术带头人信息
		 * 
		 */
		if(dto.getTechnologyleader()!=null)
			for(FounderProfileVO produce:dto.getTechnologyleader()) {
				FounderProfile product=new FounderProfile();
				BeanUtil.copyProperties(produce, product);
				product.setBlockchaincompanyid(id);
				founderprofilerepository.save(product);
			}
		/*
		 * 存储投资信息
		 */
		if(dto.getInvestmetnfinacing()!=null)
			for(InvestmentFinacingVO produce:dto.getInvestmetnfinacing()) {
				InvestmentFinancing product=new InvestmentFinancing();
				BeanUtil.copyProperties(produce, product);
				product.setBlockchaincompanyid(id);
				investrepository.save(product);
			}
	}
	public void savenewdata(BlockchainCompanyInfoDTO dto, Long id) {
		/*
		 * 存储产品信息
		 */
		List<BlockchainCompanyProduct> produces=new ArrayList<BlockchainCompanyProduct>();
		if(dto.getProductInfos()!=null)
			for(ProductInfoVO p1vo:dto.getProductInfos()) {
				BlockchainCompanyProduct p1=new BlockchainCompanyProduct();
				BeanUtils.copyProperties(p1vo, p1);
				p1.setBlockchaincompanyid(id);
				if(p1vo.getOpensource().equals("1")) 
					p1.setOpensource(true);
				else p1.setOpensource(false);
				p1.setTianbaostatus(1);
				String prodectscale=JSON.toJSON(p1vo.getProductscale()).toString();

				p1.setProductscale(prodectscale);
				productrepository.save(p1);
				List<UseCase> usecases=BeanMapper.mapList(p1vo.getUseCase(), UseCaseVO.class, UseCase.class);
				for(UseCase case1:usecases) {

					case1.setProductId(p1.getId());
					usercaserepository.save(case1);
				}


			}
		/*
		 * 存储专家信息
		 */
		if(dto.getExperts()!=null)
			for(ExpertVO p1vo:dto.getExperts()) {
				ExpertInfo p1=new ExpertInfo();
				BeanUtils.copyProperties(p1vo, p1);
				p1.setBlockchaincompanyid(id);
				if(p1vo.getPatent()!=null) {
					String patent=JSON.toJSON(p1vo.getPatent()).toString();
					p1.setPatent(patent);
				}
				if(p1vo.getArticle()!=null) {
					String article=JSON.toJSON(p1vo.getArticle()).toString();
					p1.setArticle(article);
				}
				if(p1vo.getSoftware()!=null) {
					String software=JSON.toJSON(p1vo.getSoftware()).toString();
					p1.setSoftware(software);
				}
				if(p1vo.getStandford()!=null) {
					String standford=JSON.toJSON(p1vo.getStandford()).toString();
					p1.setPatent(standford);
				}
				expertinforepository.save(p1);
			}
		/*
		 * 存储创始人信息
		 */
		if(dto.getFounderprofiles()!=null)
			for(FounderProfileVO produce:dto.getFounderprofiles()) {
				FounderProfile product=new FounderProfile();
				BeanUtil.copyProperties(produce, product);
				product.setBlockchaincompanyid(id);
				founderprofilerepository.save(product);
			}
		/*
		 * 存储投资信息
		 */
		if(dto.getInvestmetnfinacing()!=null)
			for(InvestmentFinacingVO produce:dto.getInvestmetnfinacing()) {
				InvestmentFinancing product=new InvestmentFinancing();
				BeanUtil.copyProperties(produce, product);
				product.setBlockchaincompanyid(id);
				investrepository.save(product);
			}

	}
	public BlockchainCompanyInfoVO exportByUserId(Integer userId) {
		Optional<BlockchainCompanyInfo> optional=repository.findByUserIdAndIsDelete(userId, false);

		if(optional.isPresent()) {
			BlockchainCompanyInfo info=optional.get();
			BlockchainCompanyInfoVO invos=BeanMapper.map(info,BlockchainCompanyInfoVO.class);
			invos.setId(info.getId());
			
			List<BlockchainCompanyProduct> produces=productrepository.findByBlockchaincompanyid(info.getId());

			if(produces!=null) {
				List<ProductInfoVO> productInfos=new ArrayList<ProductInfoVO>();
				for(BlockchainCompanyProduct produce:produces) {
					ProductInfoVO product=new ProductInfoVO();
					BeanUtil.copyProperties(produce, product);
					if(produce.isOpensource())
						product.setOpensource("是");
					else product.setOpensource("否");
					if(product.getProjectlevel().equals("1"))
						product.setProjectlevel("国家级");
					else if(product.getProjectlevel().equals("2"))
						product.setProjectlevel("省级");
					else if(product.getProjectlevel().equals("3"))
						product.setProjectlevel("其他");


					List<UseCase> usecases=usercaserepository.findByProductId(produce.getId());
					if(usecases!=null) {
						List<UseCaseVO> usercases=new ArrayList<UseCaseVO>();
						for(UseCase usercase:usecases) {
							UseCaseVO uscase=new UseCaseVO();
							BeanUtil.copyProperties(usercase, uscase);
							usercases.add(uscase);
						}
						product.setUseCase(usercases);
					}
					product.setSectype(sectype.get(product.getSectype()));
					product.setFirsttype(firsttype.get(product.getFirsttype()));

					JSONObject obj = JSONObject.parseObject(produce.getProductscale());
					ProductScaleVO scales = JSONObject.toJavaObject(obj,ProductScaleVO.class);//将建json对象转换为Person对象
					product.setProductscale(scales);
					productInfos.add(product);
				}
				invos.setProductInfos(productInfos);
			}
			List<ExpertInfo> experts=expertinforepository.findByBlockchaincompanyid(info.getId());
			if(experts!=null) {
				List<ExpertVO> productInfos=new ArrayList<ExpertVO>();
				for(ExpertInfo produce:experts) {
					ExpertVO product=new ExpertVO();
					BeanUtil.copyProperties(produce, product);
					List<PatentVO> patentS=JSONObject.parseArray(produce.getPatent(), PatentVO.class);
					List<PatentVO> copatent=new ArrayList<PatentVO>();
					for(PatentVO vo:patentS) {
						if(vo.getName().length()>0||vo.getPatentId().length()>0||vo.getRightdate()!=null||vo.getRightorg().length()>0||vo.getType().length()>0||vo.getUnitauthor().length()>0)
							copatent.add(vo);
					}
					product.setPatent(copatent);
					
					List<SoftwareVO> softwares=JSONObject.parseArray(produce.getSoftware(), SoftwareVO.class);
					List<SoftwareVO> cosoftware=new ArrayList<SoftwareVO>();
					for(SoftwareVO vo:softwares) {
						if(vo.getName().length()>0||vo.getAuthor().length()>0||vo.getFirstdate()!=null||vo.getLoginnumber().length()>0||vo.getRightway().length()>0)
							cosoftware.add(vo);
					}
					product.setSoftware(cosoftware);

					List<StandfordVO> standfords=JSONObject.parseArray(produce.getStandford(), StandfordVO.class);
					List<StandfordVO> costandford=new ArrayList<StandfordVO>();
					for(StandfordVO vo:standfords) {
						if(vo.getName().length()>0||vo.getStandfornId().length()>0||vo.getPublishdate()!=null||vo.getType().length()>0||vo.getUnitauthor().length()>0)
							costandford.add(vo);
					}
					product.setStandford(costandford);
					List<ArticleVO> articles=JSONObject.parseArray(produce.getArticle(), ArticleVO.class);
					List<ArticleVO> coarticles=new ArrayList<ArticleVO>();
					for(ArticleVO vo:articles) {
						if(vo.getTitle().length()>0||vo.getJourpage().length()>0||vo.getPubdate()!=null||vo.getPublisher().length()>0||vo.getUnitauthor().length()>0)
							coarticles.add(vo);
					}
					product.setArticle(coarticles);

					productInfos.add(product);
				}
				invos.setExperts(productInfos);
			}
			List<FounderProfile> founderprofile=founderprofilerepository.findByBlockchaincompanyid(info.getId());
			if(founderprofile!=null) {
				List<FounderProfileVO> create=new ArrayList<FounderProfileVO>();
				List<FounderProfileVO> techleader=new ArrayList<FounderProfileVO>();
				for(FounderProfile produce:founderprofile) {
					FounderProfileVO product=new FounderProfileVO();
					BeanUtil.copyProperties(produce, product);
					if(product.getType()==0)create.add(product);
					else techleader.add(product);
				}
				invos.setTechnologyleader(techleader);
				invos.setCreateleader(create);

			}
			List<InvestmentFinancing> investment=investrepository.findByBlockchaincompanyid(info.getId());
			if(investment!=null) {
				List<InvestmentFinacingVO> productInfos=new ArrayList<InvestmentFinacingVO>();
				for(InvestmentFinancing produce:investment) {
					InvestmentFinacingVO product=new InvestmentFinacingVO();
					BeanUtil.copyProperties(produce, product);
					productInfos.add(product);
				}
				invos.setInvestmetnfinacing(productInfos);
			}

			if(info.getIsHighTech()!=null) {
				if(info.getIsHighTech())
					invos.setIsHighTech("是");
				else invos.setIsHighTech("否");
			}
			return invos;

		}
		return null;
	}



}
